const app = getApp();
const Controller = require("../../controllers/controllers").controller

Component({
  properties: {
    type:{
      type:Number,
      value:1, 
      observer:function(newVal,oldVal,change){
        console.log(newVal)
      }
    },
    title:{
      type:String,
      value:"",
    },
    img:{
      type:String,
      value:''
    },
    path:{
      type:String,
      value:'',
      observer:function(newVal,oldVal,change){
        console.log(newVal)
      }
    },
    scenedata:{
      type:Object,
      value:'',
      observer:function(newVal,oldVal,change){
        console.log(newVal)
      }
    },
    shareid:{
      type:Number,
      value:""
    },
    show:{
      type:Boolean,
      value:false,
      observer:function(newVal,oldVal,change){
      }
    },
  },
  data: {
   navHeight:'',
   Shareimg:'',
   iswehcat:false,
   bottomLift: 0,
  },
  ready(options) {
    let {bottomLift} = app.globalData
    if(bottomLift>=0){
      app.getDeviceSize().then(res => {
        const {bottomLift} = res
        this.setData({
          bottomLift
        })
      })
    }else{
      this.setData({
        bottomLift
      })
    }
  },
  methods: {
    makeShare(){
      
      wx.navigateTo({
        url:"/pages/Share/Share?path="+this.data.path+'&id='+this.data.shareid+'&scene='+JSON.stringify(this.data.scenedata)
      });
    },
    cancel(){
      console.log(this.data.path)
      this.setData({
        show:false
      })
    },
    cancel1(){
      this.setData({
        iswehcat:false
      })
    },
  },

})